package com.ttx.pattern.example.chain.tomcat.pipeline;

import com.ttx.pattern.example.chain.tomcat.servlet.ServletRequest;
import com.ttx.pattern.example.chain.tomcat.servlet.ServletResponse;

/**
 * 参考org.apache.catalina.Valve
 *
 * @author TimFruit
 * @date 19-5-12 下午10:55
 */
public interface Valve {
    //-------------------------------------------------------------- Properties

    /**
     * @return the next Valve in the pipeline containing this Valve, if any.
     */
    public Valve getNext();


    /**
     * Set the next Valve in the pipeline containing this Valve.
     *
     * @param valve The new next valve, or <code>null</code> if none
     */
    public void setNext(Valve valve);


    //-------------------------------------------------------------- Methods

    //调用"阀门"方法
    public void invoke(ServletRequest request, ServletResponse response);
}
